package com.dongecloud.openfeign;

import com.donge.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    private HelloService helloService;
//    @Autowired
//    private HelloServiceNoExtends helloServiceNoExtends;
    @GetMapping("/hello")
    public String hello(){
        return helloService.hello();
    }

    @GetMapping("/hello1")
    public void hello1(){
        String s = helloService.hello1("二狗子");
        System.out.println(s);
        User user = new User();
        user.setId(55);
        user.setUsername("东哥");
        user.setPassword("123");
        User user1 = helloService.addUser2(user);
        System.out.println(user1);
        User user2 = new User();
        user2.setId(66);
        user2.setUsername("东哥");
        user2.setPassword("123");
        helloService.updateUser2(user2);

        helloService.deleteUser2(77);
    }

//    @GetMapping("/hello1")
//    public void hello2(){
//        String s = helloServiceNoExtends.hello1("二狗子");
//        System.out.println(s);
//        User user = new User();
//        user.setId(55);
//        user.setUsername("东哥");
//        user.setPassword("123");
//        User user1 = helloServiceNoExtends.addUser2(user);
//        System.out.println(user1);
//        User user2 = new User();
//        user2.setId(66);
//        user2.setUsername("东哥");
//        user2.setPassword("123");
//        helloServiceNoExtends.updateUser2(user2);
//
//        helloServiceNoExtends.deleteUser2(77);
//    }


}
